<include file="Public/header"/>

<link rel="stylesheet" href="/Public/admin/adminlte/bootstrap/css/bootstrap-datetimepicker.min.css">
<include file="Public/menu"/>
<!--<script src="__PUBLIC__/js/bootstrap-datepicker.js"></script>-->
<!-- 内容页 -->
<div class="content-wrapper">
    <!-- 面包屑 -->
    <section class="content-header">
        <h1>
            供应商管理
            <small>供应商列表</small>
        </h1>
        <ol class="breadcrumb">
            <li><a href="{:U('supplier/index')}"><i class="fa fa-dashboard"></i> 供应商管理</a></li>
            <li class="active">供应商列表</li>
        </ol>
    </section>
    <!-- 内容 -->
    <section class="content">
        <div class="tab-content">
            <div class="tab-pane active" id="tab_0">
                <div class="box">
                    <div class="box-header">
                        <h3 class="box-title"></h3>
                        <!--<div class="form-inline pull-right">-->
                            <!--<form action="{:U('Weixin/index')}" method="get" pjax-container="">-->
                                <!--<fieldset>-->
                                    <!--<div class="input-group input-group-sm" style="margin-right: 20px">-->
                                        <!--<span class="input-group-addon"><strong>名称</strong>-->
                                        <!--</span>-->
                                        <!--<select name="letter_type" class="form-control">-->
                                            <!--<option value="0" >-请选择-</option>-->
                                            <!--<foreach name="type_data" item="v1" key="k1" >-->
                                                <!--<option value="{$lk}" <if condition="$letter_type eq $k1 "> selected = "selected"</if>>{$v1}</option>-->
                                            <!--</foreach>-->
                                        <!--</select>-->
                                    <!--</div>-->

                                    <!--<div class="input-group input-group-sm">-->
                                        <!--<div class="input-group-btn">-->
                                            <!--<button type="submit" class="btn btn-primary"><i class="fa fa-search"></i>-->
                                            <!--</button>-->
                                        <!--</div>-->
                                    <!--</div>-->
                                <!--</fieldset>-->
                            <!--</form>-->
                        <!--</div>-->
                        <div class="btn-group pull-left" style="margin-right: 10px">
                            <a href="/Qgs/Supplier/add" class="btn btn-sm btn-success"><i class="fa fa-save"></i>&nbsp;&nbsp;新增</a>
                        </div>


                    </div>
                    <!-- /.box-header -->
                    <div class="box-body table-responsive no-padding">
                        <table class="table table-hover">
                            <tbody>
                            <tr>
                                <th>ID<a id="a_order" rank='{$rank}' onclick="rankId('id','{$rank}')" class="fa fa-fw fa-sort" href="javascript:void(0);"></a>
                                </th>
                                <th>供应商编号</th>
                                <th>供应商</th>
                                <th>供应商全称</th>
                                <th>供应类型</th>
                                <th>所属城市</th>
                                <th>负责人</th>
                                <th>联系电话</th>
                                <th>创建时间</th>
                                <th>操作</th>
                            </tr>
                            <foreach name="supplier_mgs" item="v" >
                                <tr>
                                    <td>{$v.supplier_id}</td>
                                    <td>{$v.code}</td>
                                    <td>{$v.name}</td>
                                    <td>{$v.full_name}</td>
                                    <td>{$v.type}</td>
                                    <td>{$v.province}</td>
                                    <td>{$v.principal}</td>
                                    <td>{$v.phone}</td>
                                    <td>{$v.create_time}</td>
                                    <td>
                                            <a href="/Qgs/Supplier/detail/id/{$v.supplier_id}" class="btn btn-sm btn-primary grid-refreshe">详情</a>&nbsp;&nbsp;
                                            <a data-id="{$v.supplier_id}" class="btn btn-sm btn-primary add-goods">商品</a>&nbsp;&nbsp;
                                            <a data-id="{$v.supplier_id}" class="btn btn-sm btn-primary delete-goods">已选商品</a>&nbsp;&nbsp;
                                        <a onclick="if(confirm('确定删除?')==false)return false;" href="/Qgs/Supplier/delete/id/{$v.supplier_id}" class="btn btn-sm btn-danger grid-refreshe">删除</a>
                                        </if>
                                    </td>
                                </tr>
                            </foreach>

                            </tbody>
                        </table>
                    </div>
                    <div class="box-footer clearfix">
                        <!--<input type="checkbox" class="grid-select-all">&nbsp;&nbsp;&nbsp;
                        <a class="btn btn-sm btn-danger batch-delete">Batch delete</a>-->
                        {$show}
                    </div>
                    <!-- /.box-body -->
                </div>
            </div>

        </div>
    </section>
</div>
<!-- 底部 -->
<include file="Public/common_footer"/>

<script src="/Public/layer/layer.js"></script>
<script>

    $(function () {

        $('.add-goods').on('click', function(){
            var id = $(this).data('id');
            var href = "/Qgs/Supplier/goods/id/" + id;
            var title = '供应商商品管理';
            layer.ready(function(){
                layer.open({
                    type: 2,
                    title: title,
                    fix: false,
                    maxmin: true,
                    shadeClose: true,
                    area: ['1100px', '800px'],
                    content: href,
                    end: function(){
                        layer.tips('Hi', '#about', {tips: 1})
                    }
                });
            });
        });
        $('.delete-goods').on('click', function(){
            var id = $(this).data('id');
            var href = "/Qgs/Supplier/delete_goods/id/" + id;
            var title = '供应商商品管理';
            layer.ready(function(){
                layer.open({
                    type: 2,
                    title: title,
                    fix: false,
                    maxmin: true,
                    shadeClose: true,
                    area: ['1100px', '800px'],
                    content: href,
                    end: function(){
                        layer.tips('Hi', '#about', {tips: 1})
                    }
                });
            });
        });
    })



</script>